#ifndef MOCHA_DETAIL_IMPORTED_IMAGE_PLUGIN_HPP_INCLUDED
#define MOCHA_DETAIL_IMPORTED_IMAGE_PLUGIN_HPP_INCLUDED

/**
 * @file
 */

#include <cstdint>
#include <string>
#include <boost/filesystem.hpp>
#include "mocha/color.hpp"
#include "mocha/image_plugin.hpp"
#include "mocha/imported_object.hpp"
#include "mocha/plugin.hpp"
#include "mocha/region.hpp"

namespace mocha { namespace graphics {
/**
 * 
 */
class imported_image_plugin : public imported_object<c_image_plugin>, public image_plugin {
public:
	imported_image_plugin(c_image_plugin* object, mocha_plugin_destroy_func_t destroy);
	virtual ~imported_image_plugin();
	virtual const plugin_char_t* type_name() const;
	virtual std::int32_t load(const boost::filesystem::path& file);
	virtual std::int32_t load(std::int8_t* buffer, std::uint32_t size);
	virtual std::int32_t load(std::int8_t* buffer, std::uint32_t width, std::uint32_t height, const pixel_format& format);
	virtual void free();
	virtual std::int32_t crop(const region<std::int32_t>& region);
	virtual std::int32_t scale(std::uint32_t width, std::uint32_t height);
	virtual std::int32_t convert(const pixel_format& format);
	virtual void pixels(std::int8_t*& buffer, std::uint32_t* size);
	virtual void pixels(std::int8_t const *& buffer, std::uint32_t* size) const;
	virtual std::int32_t format(pixel_format& format) const;
	virtual std::uint32_t width() const;
	virtual std::uint32_t height() const;
	virtual std::int8_t loaded() const;
};
}}

#endif

